package com.moc.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.moc.common.annotation.Excel;
import com.moc.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * MinIO文件存储对象 sys_minio_file
 *
 * @author wangbf
 * @date 2025-09-15
 */
public class SysMinioFile extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 文件MD5校验值 */
    @Excel(name = "文件MD5校验值")
    private String fileMd5;

    /** 存储文件名 */
    @Excel(name = "存储文件名")
    private String fileName;

    /** 文件大小（字节） */
    @Excel(name = "文件大小", readConverterExp = "字=节")
    private Long fileSize;

    /** 文件MIME类型 */
    @Excel(name = "文件MIME类型")
    private String fileType;

    /** 原始文件名 */
    @Excel(name = "原始文件名")
    private String originalFilename;

    /** MinIO存储桶名称 */
    @Excel(name = "MinIO存储桶名称")
    private String bucketName;

    /** 文件扩展名 */
    @Excel(name = "文件扩展名")
    private String fileExtension;

    /** 存储路径（冗余） */
    @Excel(name = "存储路径", readConverterExp = "冗=余")
    private String storagePath;

    /** 上传用户 */
    @Excel(name = "上传用户")
    private String uploadUser;

    /** 上传时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date uploadTime;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setFileMd5(String fileMd5)
    {
        this.fileMd5 = fileMd5;
    }

    public String getFileMd5()
    {
        return fileMd5;
    }

    public void setFileName(String fileName)
    {
        this.fileName = fileName;
    }

    public String getFileName()
    {
        return fileName;
    }

    public void setFileSize(Long fileSize)
    {
        this.fileSize = fileSize;
    }

    public Long getFileSize()
    {
        return fileSize;
    }

    public void setFileType(String fileType)
    {
        this.fileType = fileType;
    }

    public String getFileType()
    {
        return fileType;
    }

    public void setOriginalFilename(String originalFilename)
    {
        this.originalFilename = originalFilename;
    }

    public String getOriginalFilename()
    {
        return originalFilename;
    }

    public void setBucketName(String bucketName)
    {
        this.bucketName = bucketName;
    }

    public String getBucketName()
    {
        return bucketName;
    }

    public void setFileExtension(String fileExtension)
    {
        this.fileExtension = fileExtension;
    }

    public String getFileExtension()
    {
        return fileExtension;
    }

    public void setStoragePath(String storagePath)
    {
        this.storagePath = storagePath;
    }

    public String getStoragePath()
    {
        return storagePath;
    }

    public void setUploadUserId(String uploadUser)
    {
        this.uploadUser = uploadUser;
    }

    public String getUploadUser()
    {
        return uploadUser;
    }

    public void setUploadTime(Date uploadTime)
    {
        this.uploadTime = uploadTime;
    }

    public Date getUploadTime()
    {
        return uploadTime;
    }

    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag()
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("fileMd5", getFileMd5())
            .append("fileName", getFileName())
            .append("fileSize", getFileSize())
            .append("fileType", getFileType())
            .append("originalFilename", getOriginalFilename())
            .append("bucketName", getBucketName())
            .append("fileExtension", getFileExtension())
            .append("storagePath", getStoragePath())
            .append("uploadUser", getUploadUser())
            .append("uploadTime", getUploadTime())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
